{smcl}
{* 25May2006}{...}
{hline}
{hi:help ivreset}{right:(SJ7-4: st0030_3)}
{hline}

{title:Title}

{p2colset 5 16 18 2}{...}
{p2col:{hi:ivreset} {hline 2}}Perform Ramsey/Pesaran-Taylor/Pagan-Hall RESET specification test after IV/GMM/OLS estimation{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 14 2}{cmd:ivreset}
{bind:[{cmd:,} {cmdab:poly:nomial(}{it:#}{cmd:)}}
{cmdab:rf:orm}
{cmd:cstat}
{cmd:small}]

{pstd}{cmd:ivreset} is for use after {helpb ivreg2} and {helpb regress}.


{title:Description}

{pstd}{cmd:ivreset} performs various types of Ramsey's (1969) regression 
specification-error test (RESET) as adapted by Pesaran and Taylor (1999) and
Pagan and Hall (1983) for instrumental variables (IV) estimation.  RESET
is sometimes called an omitted variables test but probably is best
interpreted as a test of neglected nonlinearities in the choice of functional
form (Wooldridge 2002, 124-125).  Under the null that there are no neglected
nonlinearities, the residuals should be uncorrelated with low-order polynomials
in y-hat, where the y-hats are the forecast values of the dependent variable
(see below).  The test types vary according to the polynomial terms (square,
cube, fourth power of y-hat), the choice of forecast values (Pesaran-Taylor
optimal forecasts or Pagan-Hall reduced-form forecasts), test statistic (Wald
or GMM distance), and large versus small sample statistic (chi-squared or F
statistic).  The test statistic is distributed with degrees of freedom equal
to the number of polynomial terms.  The default is the Pesaran-Taylor version
using the square of the optimal forecast of y and a chi-squared Wald statistic
with one degree of freedom.

{pstd}If the original {cmd:ivreg2} or {cmd:regress} estimation was
heteroskedasticity-robust, cluster-robust, autocorrelation-consistent (AC), or
heteroskedastic and autocorrelation-consistent (HAC), RESET will be reported
as well.

{pstd}{cmd:ivreset} can also be used after ordinary least squares (OLS) or
heteroskedastic OLS (HOLS) regression with {cmd:regress} or {cmd:ivreg2}, when
there are no endogenous regressors.  Here a standard RESET using fitted values
of y is reported.


{title:Options}

{phang}{cmd:polynomial(}{it:#}{cmd:)} requests a second-, third-, or
fourth-order polynomial in y-hat.  The default is a second-order polynomial,
i.e., y-hat squared.

{phang}{cmd:rform} requests the Pagan-Hall (1983) version of RESET
for IV regression instead of the default Pesaran-Taylor (1999) version.  The
Pagan-Hall version uses the reduced-form forecast y-hat of the dependent
variable y, as opposed to the default Pesaran-Taylor version that uses an
optimal forecast (see below).

{phang}{cmd:cstat} requests a C-test statistic, also known as a GMM distance
or difference-in-Sargan test statistic (see below), instead of the default
Wald statistic.

{phang}{cmd:small} requests a small-sample F statistic instead of the default
chi-squared statistic.


{title:Remarks}

{pstd}RESET is a standard test of neglected
nonlinearities in the choice of functional form (sometimes, perhaps
misleadingly, also described as a test for omitted variables; see {helpb ovtest}
and Wooldridge (2002, 124-125).  The principle is to estimate
y=X*beta+W*gamma+u and then test the significance of gamma.  The W's in RESET
can either be powers of X or, as implemented here, powers of the forecast
values of y.

{pstd}As Pagan and Hall (1983) and Pesaran and Taylor (1999) point out,  RESET
for an IV regression cannot use the standard IV predicted values
X*beta-hat, because X includes endogenous regressors that are correlated with
u.  Instead, RESET needs to be implemented using forecast values of
y that are functions of the instruments (exogenous variables) only.

{pstd}Denote the full set of instruments by Z (possibly including exogenous
regressors also in X).

{pstd}In the Pagan-Hall version of the test, the forecast values y-hat are the
reduced-form predicted values of y, i.e., the predicted values Z*pi-hat from a
regression of y on the instruments Z.

{pstd}In the Pesaran-Taylor version of the test, the forecast values y-hat are
the optimal forecast values.  The optimal forecast (predictor) y-hat is
defined as X-hat*beta-hat, where beta-hat is the IV estimate of the coefficients
and X-hat consists of the exogenous regressors in X and the reduced-form
predicted values of the endogenous regressors in X.  The latter are the
predicted values Z*pi-hat from regressions of the endogenous X's on the
instruments Z.  If the equation is exactly identified, the optimal
forecasts and reduced-form forecasts coincide, and the Pesaran-Taylor and
Pagan-Hall tests are identical.

{pstd}In both the Pesaran-Taylor and Pagan-Hall versions of RESET, the
augmented equation is y=X*beta+W*gamma+u, where the W's are the powers of y-hat.
The default is squares of y-hat, but 3rd and 4th powers of y-hat can be
requested.  This equation is estimated by IV, and the default test statistic is
a Wald test of the significance of gamma.  Under the null that there are no
neglected nonlinearities and the equation is otherwise well specified, the test
statistic is distributed as chi-squared with degrees of freedom equal to the
number of powers of y-hat.

{pstd}Godfrey has also suggested that a C-test statistic (also known
as a GMM distance or difference-in-Sargan test) be used to test whether the
powers of y-hat can be added to the orthogonality or moment conditions that
define the IV or OLS estimator (see Pesaran and Taylor, 262-263).  This test
can be requested with the {cmd:cstat} option.  Under the null that the equation
is well specified and has no neglected nonlinearities, J-J1 is distributed as
chi-squared with degrees of freedom equal to the number of powers of y-hat,
where J1 is the Sargan-Hansen statistic for the original IV estimation and J is
the Sargan-Hansen statistic for the IV estimation using the additional
orthogonality conditions provided by the powers of y-hat.  For a general
discussion of this test, see {helpb ivreg2} (if installed) and Hayashi
(2000, 218-222, 232-234).

{pstd}If the equation was estimated using OLS or HOLS 
(see {helpb ivreg2}) and there there are no endogenous regressors,
{cmd:ivreset} reports a standard RESET using the fitted values of
y, i.e., X*beta-hat.  If the original estimation was OLS or HOLS, the
excluded instruments (if any) are ignored by {cmd:ivreset}.

{pstd}If the original equation was estimated using {cmd:robust},
{cmd:cluster()}, or {cmd:bw()}, so is the augmented equation, and RESET
statistic will be heteroskedasticity-, cluster-, and/or autocorrelation-robust,
respectively.


{title:Saved results}

{pstd}{cmd:ivreset} saves the value of the test statistic, its p-value, and the
degrees of freedom of the test.  See {cmd:return list}.


{title:Examples}

{p 8 12 2}{stata "use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta" : . use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta }{p_end}

{p 8 12 2}{stata "ivreg2 lw s expr tenure rns smsa (iq=med kww)" : . ivreg2 lw s expr tenure rns smsa (iq=med kww)}

{pstd}(Default: second-order polynomial in y-hat, Pesaran-Smith optimal forecast, Wald chi-squared statistic)

{p 8 12 2}{stata "ivreset" : . ivreset}{p_end}

{pstd}(If estimation is heteroskedasticity-robust so are RESET){p_end}

{p 8 12 2}{stata "ivreg2 lw s expr tenure rns smsa (iq=med kww), robust" : . ivreg2 lw s expr tenure rns smsa (iq=med kww), robust}

{pstd}(Fourth-order polynomial, Pagan-Hall reduced-form forecast, Wald F statistic)

{p 8 12 2}{stata "ivreset, poly(4) rf small" : . ivreset, poly(4) rf small}{p_end}

{pstd}(Third-order polynomial, Pesaran-Smith optimal forecast, C (GMM distance) chi-squared statistic)

{p 8 12 2}{stata "ivreset, poly(3) cstat" : . ivreset, poly(3) cstat}{p_end}


{title:References}

{phang}Baum, C. F., M. E. Schaffer, and S. Stillman. 2003.
Instrumental variables and GMM: Estimation and testing.
{it:Stata Journal} 3: 1-31.

{phang}Hayashi, F. 2000. {it:Econometrics}.
Princeton: Princeton University Press.

{phang}Pagan, A. R., and D. Hall. 1983.
Diagnostic tests as residual analysis.
{it:Econometric Reviews} 2: 159-218.

{phang}Pesaran, M. H., and L. W. Taylor. 1999.
Diagnostics for IV regressions.
{it:Oxford Bulletin of Economics and Statistics} 61: 255-281.

{phang}Ramsey, J. B. 1969.
Tests for specification errors in a classical linear least squares regression
analysis.
{it:Journal of the Royal Statistical Society, Series B} 31: 350-371.

{phang}Wooldridge, J. M. 2002.
{it:Econometric Analysis of Cross Section and Panel Data}.
Cambridge, MA: MIT Press.


{title:Author}

{pstd}Mark E Schaffer, Heriot-Watt University, UK{p_end}
{pstd}m.e.schaffer@hw.ac.uk{p_end}


{title:Also see}

{psee}Manual:  {hi:[R] regression diagnostics}{p_end}

{psee}Online:  {helpb ivreg2}, {helpb ivhettest}, {helpb ivendog} (if installed){p_end}
